CREATE TABLE [dbo].[Person]
(
[nCode] [numeric] (18, 0) NOT NULL IDENTITY(1, 1),
[Clastname] [varchar] (30) COLLATE Cyrillic_General_CI_AS NOT NULL,
[Cfirstname] [varchar] (30) COLLATE Cyrillic_General_CI_AS NOT NULL,
[Cotch] [varchar] (30) COLLATE Cyrillic_General_CI_AS NOT NULL,
[Dd_birth] [datetime] NULL,
[Cplacebirth] [varchar] (300) COLLATE Cyrillic_General_CI_AS NULL,
[Linval] [bit] NULL CONSTRAINT [DF_Person_Linval] DEFAULT ((0)),
[Ldeti] [bit] NULL CONSTRAINT [DF_Person_Ldeti] DEFAULT ((0)),
[Lrab] [bit] NULL CONSTRAINT [DF_Person_Lrab] DEFAULT ((0)),
[lSex] [bit] NULL,
[Lobchegit] [bit] NULL,
[cSotTel] [varchar] (50) COLLATE Cyrillic_General_CI_AS NULL,
[ctelefon] [varchar] (20) COLLATE Cyrillic_General_CI_AS NULL,
[cEmail] [varchar] (50) COLLATE Cyrillic_General_CI_AS NULL,
[Photo] [image] NULL,
[Ik_grazd] [int] NULL,
[Ik_sem_pol] [int] NULL,
[cInn] [varchar] (20) COLLATE Cyrillic_General_CI_AS NULL,
[cStrax] [varchar] (20) COLLATE Cyrillic_General_CI_AS NULL,
[ik_voen_zvanie] [int] NULL,
[itab_n] [int] NULL,
[ik_nac] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD CONSTRAINT [CheckPersonCfirstname] CHECK (([Cfirstname]<>''))
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD CONSTRAINT [CheckPersonClastName] CHECK (([ClastName]<>''))
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD CONSTRAINT [CheckPersonCotch] CHECK (([Cotch]<>''))
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD CONSTRAINT [CheckPersonDd_birth] CHECK (([Dd_birth] IS NULL OR datepart(year,[Dd_birth])<(datepart(year,getdate())-(14)) AND datepart(year,[Dd_birth])>(1930)))
GO
ALTER TABLE [dbo].[Person] ADD CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED  ([nCode]) ON [PRIMARY]
GO
